# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1BulkDeleteDocumentsMetadata do
  @moduledoc """
  Metadata for google.longrunning.Operation results from FirestoreAdmin.BulkDeleteDocuments.

  ## Attributes

  *   `collectionIds` (*type:* `list(String.t)`, *default:* `nil`) - The IDs of the collection groups that are being deleted.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - The time this operation completed. Will be unset if operation still in progress.
  *   `namespaceIds` (*type:* `list(String.t)`, *default:* `nil`) - Which namespace IDs are being deleted.
  *   `operationState` (*type:* `String.t`, *default:* `nil`) - The state of the operation.
  *   `progressBytes` (*type:* `GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1Progress.t`, *default:* `nil`) - The progress, in bytes, of this operation.
  *   `progressDocuments` (*type:* `GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1Progress.t`, *default:* `nil`) - The progress, in documents, of this operation.
  *   `snapshotTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp that corresponds to the version of the database that is being read to get the list of documents to delete. This time can also be used as the timestamp of PITR in case of disaster recovery (subject to PITR window limit).
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - The time this operation started.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :collectionIds => list(String.t()) | nil,
          :endTime => DateTime.t() | nil,
          :namespaceIds => list(String.t()) | nil,
          :operationState => String.t() | nil,
          :progressBytes =>
            GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1Progress.t() | nil,
          :progressDocuments =>
            GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1Progress.t() | nil,
          :snapshotTime => DateTime.t() | nil,
          :startTime => DateTime.t() | nil
        }

  field(:collectionIds, type: :list)
  field(:endTime, as: DateTime)
  field(:namespaceIds, type: :list)
  field(:operationState)
  field(:progressBytes, as: GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1Progress)
  field(:progressDocuments, as: GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1Progress)
  field(:snapshotTime, as: DateTime)
  field(:startTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1BulkDeleteDocumentsMetadata do
  def decode(value, options) do
    GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1BulkDeleteDocumentsMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Firestore.V1beta1.Model.GoogleFirestoreAdminV1BulkDeleteDocumentsMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
